<?php

use Illuminate\Support\Facades\Route;

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

//后台登录接口
Route::namespace('Backend')->group(function () {
    //登录
    //Route::middleware(['web'])->post('login', [App\Backend\Controllers\LoginController::class, 'login']);
    Route::post('login', [App\Backend\Controllers\LoginController::class, 'login']);
    //获取验证码
    //Route::middleware(['web'])->get('captcha/{tmp}', [App\Backend\Controllers\LoginController::class, 'captcha']);
    Route::get('captcha/{tmp}', [App\Backend\Controllers\LoginController::class, 'captcha']);
    //发送短信
    Route::post('sms', [\App\Backend\Controllers\SmsController::class, 'sms']);
    //短信验证码验证
    Route::post('captchValidate', [\App\Backend\Controllers\SmsController::class, 'captchValidate']);
    //忘记密码
    Route::post('forgotPassword', [App\Backend\Controllers\LoginController::class, 'forgotPassword']);
    //banner 图列表
    Route::post('bannerList', [App\Backend\Controllers\BannerController::class, 'getList']);
    // banner 图详情
    Route::post('bannerdetail', [App\Backend\Controllers\BannerController::class, 'detail']);
    //banner 图添加
    Route::post('bannerAdd', [App\Backend\Controllers\BannerController::class, 'add']);
    //banner 图修改
    Route::post('bannerEdit', [App\Backend\Controllers\BannerController::class, 'edit']);
    //banner 图删除
    Route::post('bannerDel', [App\Backend\Controllers\BannerController::class, 'del']);
    //app版本更新列表
    Route::post('appVersionList', [App\Backend\Controllers\AppVersionController::class, 'getList']);
    //app 版本更新添加
    Route::post('appVersionAdd', [App\Backend\Controllers\AppVersionController::class, 'add']);
    //app 版本更新详情
    Route::post('appVersiondetail', [App\Backend\Controllers\AppVersionController::class, 'detail']);
    //app 版本更新修改
    Route::post('appVersionEdit', [App\Backend\Controllers\AppVersionController::class, 'edit']);
    //app 版本更新删除
    Route::post('appVersionDel', [App\Backend\Controllers\AppVersionController::class, 'del']);
    //消息管理列表
    Route::post('messageNewsList', [App\Backend\Controllers\MessageNewsController::class, 'getList']);
    //消息管理添加
    Route::post('messageNewsAdd', [App\Backend\Controllers\MessageNewsController::class, 'add']);

    //消息管理-详情
    Route::post('messageNewsdetail', [App\Backend\Controllers\MessageNewsController::class, 'detail']);
    //消息管理修改
    Route::post('messageNewsEdit', [App\Backend\Controllers\MessageNewsController::class, 'edit']);
    //消息管理删除
    Route::post('messageNewsDel', [App\Backend\Controllers\MessageNewsController::class, 'del']);

    // 城市列表
    Route::post('citylist', [App\Backend\Controllers\CityController::class, 'getList']);

    //市场行情
    Route::post('marketInfolist', [App\Backend\Controllers\MarketInfoController::class, 'getList']);
    Route::post('marketInfodetail', [App\Backend\Controllers\MarketInfoController::class, 'detail']);
    Route::post('marketInfoadd', [App\Backend\Controllers\MarketInfoController::class, 'add']);
    Route::post('marketInfoedit', [App\Backend\Controllers\MarketInfoController::class, 'edit']);
    Route::post('marketInfodel', [App\Backend\Controllers\MarketInfoController::class, 'del']);


    // 装修推荐
    Route::post('renovationlist', [App\Backend\Controllers\RenovationController::class, 'getList']);
    Route::post('renovationdetail', [App\Backend\Controllers\RenovationController::class, 'detail']);
    Route::post('renovationadd', [App\Backend\Controllers\RenovationController::class, 'add']);
    Route::post('renovationedit', [App\Backend\Controllers\RenovationController::class, 'edit']);
    Route::post('renovationdel', [App\Backend\Controllers\RenovationController::class, 'del']);


        
    //上传
    Route::post('upload', [\App\Backend\Controllers\FileUploadController::class, 'upload']);


    //费用对比
    Route::post('moneyVsadd', [\App\Backend\Controllers\MoneyVsController::class, 'add']);
    Route::post('moneyVslist', [\App\Backend\Controllers\MoneyVsController::class, 'getList']);
    Route::post('moneyVsedit', [\App\Backend\Controllers\MoneyVsController::class, 'edit']);
    Route::post('moneyVstype', [\App\Backend\Controllers\MoneyVsController::class, 'get_money_vs_type']);
    Route::post('moneyVsedel', [\App\Backend\Controllers\MoneyVsController::class, 'del']);

});


Route::group(['middleware' => ['auth.jwt.backend']], function () 
{
    //bnner 图列表
    //Route::post('bannerList', [App\Backend\Controllers\BannerController::class, 'getList']);
    //退出
    Route::post('logout', [\App\Backend\Controllers\LoginController::class, 'logout']);
    //管理员
    Route::post('admin/add', [\App\Backend\Controllers\AdminController::class, 'add']);
    Route::post('admin/edit', [\App\Backend\Controllers\AdminController::class, 'edit']);
    Route::post('admin/detail', [\App\Backend\Controllers\AdminController::class, 'detail']);
    Route::post('admin/getList', [\App\Backend\Controllers\AdminController::class, 'getList']);
    Route::post('admin/del', [\App\Backend\Controllers\AdminController::class, 'del']);
    Route::get('admin/export', [\App\Backend\Controllers\AdminController::class, 'export']);
    //角色
    Route::post('role/add', [\App\Backend\Controllers\RoleController::class, 'add']);
    Route::post('role/edit', [\App\Backend\Controllers\RoleController::class, 'edit']);
    Route::post('role/detail', [\App\Backend\Controllers\RoleController::class, 'detail']);
    Route::post('role/getList', [\App\Backend\Controllers\RoleController::class, 'getList']);
    Route::post('role/del', [\App\Backend\Controllers\RoleController::class, 'del']);
    //权限
    Route::post('auth/add', [\App\Backend\Controllers\AuthController::class, 'add']);
    Route::post('auth/edit', [\App\Backend\Controllers\AuthController::class, 'edit']);
    Route::post('auth/detail', [\App\Backend\Controllers\AuthController::class, 'detail']);
    Route::post('auth/getList', [\App\Backend\Controllers\AuthController::class, 'getList']);
    Route::post('auth/getAuthSelect', [\App\Backend\Controllers\AuthController::class, 'getAuthSelect']);
    Route::post('auth/del', [\App\Backend\Controllers\AuthController::class, 'del']);


    //网站配置
    Route::post('webSite/configuration', [\App\Backend\Controllers\WebSiteController::class, 'configuration']);
    Route::post('webSite/detail', [\App\Backend\Controllers\WebSiteController::class, 'detail']);
    
    //添加白名单
    Route::post('webSite/addWhite', [\App\Backend\Controllers\WebSiteController::class, 'addWhite']);
    Route::post('webSite/whiteList', [\App\Backend\Controllers\WebSiteController::class, 'whiteList']);
    Route::post('webSite/delWhite', [\App\Backend\Controllers\WebSiteController::class, 'delWhite']);

    
     //日志列表
     Route::post('adminLog/getList', [App\Backend\Controllers\AdminLogController::class, 'getList']);
     //日志详情
     Route::post('adminLog/detail', [App\Backend\Controllers\AdminLogController::class, 'getInfo']);

    //个人信息
    Route::post('profile/editInfo', [\App\Backend\Controllers\ProfileController::class, 'editInfo']);
    Route::post('profile/detail', [\App\Backend\Controllers\ProfileController::class, 'detail']);
    Route::post('profile/updateMobile', [\App\Backend\Controllers\ProfileController::class, 'updateMobile']);
    Route::post('profile/updatePassword', [\App\Backend\Controllers\ProfileController::class, 'updatePassword']);

});
